package edu.unindra.raport.template;

import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;

import javax.swing.JPanel;
import javax.swing.ImageIcon;

public class PanelBackGround extends JPanel {
	public PanelBackGround() {
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = -7354646817447687705L;

	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);

		Image gambar = new ImageIcon(getClass().getResource(
				"/edu/unindra/raport/image/School.png")).getImage();

		GradientPaint paint = new GradientPaint(0, 0, Color.WHITE, 0,
				getHeight(), Color.GRAY);

		Graphics2D g2 = (Graphics2D) g.create();
		g2.setPaint(paint);
		g2.fillRect(0, 0, getWidth(), getHeight());
		g2.setComposite(AlphaComposite.SrcOver.derive(0.25F));
		g2.drawImage(gambar, 0, 0, getWidth(), getHeight(), null);
	}

}
